#include "Connection.h"
#include <iostream>
using namespace std;

/*
CREATE TABLE IF NOT EXISTS test_users (
    id INT AUTO_INCREMENT PRIMARY KEY COMMENT '用户ID',
    username VARCHAR(50) NOT NULL COMMENT '用户名',
    email VARCHAR(100) NOT NULL COMMENT '邮箱',
    age TINYINT UNSIGNED DEFAULT 0 COMMENT '年龄',
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='测试用户表';

-- 插入单条测试数据
INSERT INTO test_users (username, email, age)
VALUES ('test_user', 'user@example.com', 25);

-- 插入多条测试数据（可选）
INSERT INTO test_users (username, email, age) VALUES
('john_doe', 'john@example.com', 30),
('jane_smith', 'jane@example.com', 28),
('bob_jackson', 'bob@example.com', 35);
*/

int main()
{
    Connection conn;

    if (conn.connect("127.0.0.1", 3306, "root", "123456", "test"))
    {
        cout << "连接成功" << endl;
    }
    
    string sql = "INSERT INTO test_users (username, email, age) VALUES ('zhangsan', 'user@example.com', 25)";

    conn.update(sql);

    return 0;
}